<template>
  <div class="newsinfo-container">
    <h3 class="subtitle">新闻标题---{{ id }}</h3>
    <p class="subitem">
      <span>发表时间：{{ message.datetime | dateFormat }}</span>

      <span>点击：0 次</span>
    </p>
    <hr />
    <p class="content">第一次世界大战</p>
    <commentBox :id="this.id"></commentBox>
  </div>
</template>

<script>
import comment from "../subcomment/Comment.vue";
export default {
  data() {
    return {
      id: this.$route.params.id,
      message: {
        datetime: new Date(),
      },
    };
  },
  components: {
    commentBox: comment,
  },
};
</script>

<style lang="scss" scoped>
.newsinfo-container {
  margin: 0 4px;
  hr {
    margin: 2px 0;
  }
  .subtitle {
    color: red;
    font-size: 14px;
    text-align: center;
  }
  .subitem {
    color: royalblue;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
  }
  .content {
    font-size: 13px;
  }
}
</style>